import request from '@/utils/request'

const api = {
  collectionDetailQuery: '/collectionDetail/query',
  earlyRepaymentQuery: '/earlyRepayment/query',
  handleEarlyRepayment: '/earlyRepayment/handle'
}

/**
 * collectionDetailQuery func
 * parameter: {
 *     pageNum: '',
 *     pageSize: '',
 *     contractNo: '',
 *     payTransactionId: '',
 *     userKeyword'',
 *     merchantKeyword:'',
 *     startActualRepaymentTime:'',
 *     endActualRepaymentTime:''
 * }
 * @param parameter
 * @returns {*}
 */
export function getStatementList (parameter) {
  return request({
    url: api.collectionDetailQuery,
    method: 'post',
    data: parameter
  })
}

/**
 * earlyRepaymentQuery func
 * parameter: {
 *     pageNum: '',
 *     pageSize: '',
 *     contractNo: '',
 *     payTransactionId: '',
 *     receiveStatus'',
 *     repaymentPlanName:'',
 *     userKeyword:'',
 *     merchantKeyword:'',
 *     startActualRepaymentTime:'',
 *     endActualRepaymentTime:'',
 *     startReceiveHandleResult:'',
 *     endReceiveHandleResult:'
 * }
 * @param parameter
 * @returns {*}
 */
export function getEarlyRepaymentList (parameter) {
  return request({
    url: api.earlyRepaymentQuery,
    method: 'post',
    data: parameter
  })
}

/**
 * handleEarlyRepayment func
 * parameter: {
 *     repaymentId: '',
 *     receiveHandleResult: '',
 *     receivePics: '',
 * }
 * @param parameter
 * @returns {*}
 */
export function handleEarlyRepayment (parameter) {
  return request({
    url: api.handleEarlyRepayment,
    method: 'post',
    data: parameter
  })
}
